<div class="special-check main equipmentInfo">
  <div class="pa-form-container shadowbox">
    <div class="container-header">
      设备信息
    </div>
    <div class="pa-form-content">
      <form class="clear">
        <div class="row">
          <div class="pa-form-control fl">
            <label>设备名称:</label>
            <input type="text"
              ng-model="equipmentInfo.queryData.deviceName">
          </div> 
          <div class="pa-form-control fl">
            <label>内部编号:</label>
            <input type="text"
              ng-model="equipmentInfo.queryData.innerNo">
          </div>                 
          <div class="pa-form-control fl">
            <label>设备等级:</label>
            <select id="type" name="type"
              ng-model="equipmentInfo.queryData.deviceLevel">
              <option value=""></option>
              <option value="1">一般设备</option>
              <option value="2">主要设备</option>
              <option value="4">特种设备</option>
            </select>
          </div>
          <div class="pa-form-control fl">
            <label>项目部:</label>
            <select name="type"
              class="pa-input-select"
              style="width:240px"
              ng-model="equipmentInfo.queryData.orgId">
              <option value=""></option>
              <option value="{{::item.orgUnitId}}"
                ng-repeat="item in equipmentInfo.orgList">
                {{::item.orgUnitName}}
              </option>
            </select>
          </div>
        </div>       
        <a class="pa-float-btn reset-btn"
          ng-click="equipmentInfo.reset();">
          <i class="fa fa-repeat"></i>
          <span class="ml5">重置</span>
        </a>
        <a class="pa-float-btn query"
          ng-click="equipmentInfo.query();">
          <i class="fa fa-search"></i>
          <span class="ml5">查询</span>
        </a>
      </form>
    </div>
  </div>
  <div class="btn-registration">    
    <a class="pa-btn"
      authorization-btn="api/deviceinfo/insertDeviceInfo"     
      ng-click="$state.go('equipmentInfoNew')">
      新增设备
    </a>
    <a class="pa-btn"
      authorization-btn="api/deviceinfo/updateDeviceInOutRecord"
      ng-click="equipmentInfo.openEquipPatchExitDialog()">
      离场登记
    </a>
    <a class="pa-btn"
    ng-click="equipmentInfo.printQrCode()">
      打印二维码
    </a>
  </div>
  <div class="pa-table-container shadowbox">
    <div class="table-outer">
      <form class="base-info">
        <table class="pa-table">
          <thead>
            <tr>
              <th>
                <input type="checkbox"
                  ng-model="equipmentInfo.toggleAllFlag"
                  ng-click="equipmentInfo.toggleAll()"/>全选
              </th>
              <th>设备名称</th>
              <th>内部编号</th>
              <th>设备型号</th>
              <th>设备等级</th>
              <th class="time-sequence">
                <div>进场时间</div>
                <div class="time-sequence-btn">
                  <div class="time-sequence-box"
                    ng-click="equipmentInfo.up('approach_time','0')">
                    <i class="fa fa-caret-up"></i>
                  </div>
                  <div class="time-sequence-box"
                    ng-click="equipmentInfo.up('approach_time','1')">
                    <i class="fa fa-caret-down"></i>
                  </div> 
                </div>
              </th>
              <th class="time-sequence">
                <div>出场时间</div>
                <div class="time-sequence-btn">
                  <div class="time-sequence-box"
                    ng-click="equipmentInfo.up('exit_time','0')">
                    <i class="fa fa-caret-up"></i>
                  </div>
                  <div class="time-sequence-box"
                    ng-click="equipmentInfo.up('exit_time','1')">
                    <i class="fa fa-caret-down"></i>
                  </div> 
                </div>
              </th>
              <th>操作员</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="item in equipmentInfo.equipmentItemList">
              <td>
                <input type="checkbox"
                  ng-model="item.checked"
                  ng-change="equipmentInfo.isChange()"/>
              </td>
              <td>{{item.deviceName}}</td>
              <td>{{item.innerNo}}</td>
              <td>{{item.deviceModel}}</td>
              <td>{{item.deviceLevel == '1' ? '一般设备' : 
               item.deviceLevel == '2' ? '主要设备' : 
               item.deviceLevel == '4' ? '特种设备' : ''}}</td>
              <td>{{item.approachTime}}</td>
              <td>{{item.exitTime}}</td>
              <td>{{item.operator}}</td>
              <td class="check">
                <div class="del"                  
                  authorization-btn="api/deviceinfo/queryDeviceDetail"  
                  ng-click="$state.go('equipmentInfoDetail',{id: item.id})">
                  <i class="fa fa-street-view color"></i>
                  <span>查看</span>
                </div>
                <div class="del"
                  authorization-btn="api/deviceinfo/deleteDeivceInfo"    
                  ng-click="equipmentInfo.delete(item.id)">
                  <i class="fa fa-trash color"></i>
                  <span>
                    删除
                  </span>
                </div>               
              </td>
            </tr>
          </tbody>
        </table> 
      </form>
      <div class="total-num">
        共计<span class="total-num-colorful">{{equipmentInfo.paginationData.total}}</span>条
      </div>
      <!-- 分页 -->
      <div class="pagination-outer">
        <uib-pagination
          total-items="equipmentInfo.paginationData.total"
          ng-model="equipmentInfo.paginationData.pageNum"
          items-per-page="equipmentInfo.paginationData.pageSize"
          ng-change="pageChange()"
          class="pagination-sm"
          boundary-link-numbers="true"
          max-size="5"
          next-text="下一页"
          previous-text="上一页"></uib-pagination>
      </div>
    </div>
  </div>

  <script type="text/ng-template" id="equipPatchExitDialog">
    <div class="item-detail-dialog">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>设备批量出场</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div desc="autofocus-input">
          <input type="text" autofocus="true" 
            style="opacity: 0;width: 0; height: 0;" />
        </div>
        <div class="row-item">
          <div class="fixed-left-label">出场时间：</div>
          <div class="right-value">
            <input name="exitTime" type="text" ng-datepicker
              ng-model="vm.outPlantTime"/>
          </div>
        </div>           
      </div>
      <div class="item-detail-dialog-footer"
       ng-click="vm.submit()">
        <a class="pa-btn">
          <i class="fa fa-save"></i>
          <span class="ml5">确定</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span class="ml5">取消</span>
        </a>
      </div>
    </div>
  </script>

  <script type="text/ng-template" id="equipInfoQrCodePrintDialog">
    <div class="item-detail-dialog">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>设备信息二维码</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div class="qr-print-scroll-outer">
          <div class="qr-print" style="width: 224px;">
            <div class="qr-item" style="width: 224px; height: 168px; overflow: hidden;word-wrap: break-word; padding: 10px;"
              ng-repeat="item in selectedEquipList">
              <table class="qr-info" style="width: 100%; height: 100%;">
                <tr>
                  <td class="qr-info" style="font-size: 16px;font-weight: 600;">
                    <div style="width: 90px;word-wrap: break-word;padding-right: 6px;">
                      {{::item.deviceName}}
                    </div>
                    <div style="width: 90px;word-wrap: break-word;padding-right: 6px;">
                      {{::item.deviceModel}}
                    </div>
                  </td>
                  <td class="qr-img">
                    <img style="width:120px;"
                      ng-src="{{vm.getQrCodeSrc(item)}}">
                  </td>
                </tr>
              </table>
            </div>
          </div>
        </div>
      </div>
      <div class="item-detail-dialog-footer" style="text-align:center;">
        <a class="pa-btn" ng-click="vm.print()">
          <i class="fa fa-save"></i>
          <span>打印</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span>取消</span>
        </a>
      </div>
    </div>
  </script>
</div>